<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .father {
      width: 400px;
      height: 400px;
      background-color: pink;
    }

    .son {
      /* 1、块级元素宽度不设置，默认占满父元素一行 */
      /* width: 100px; */
      height: 100px;
      background-color: blue;

      /* 2、此时左右的border和padding是不会撑大盒子的 */
      border-left: 10px solid red;
      border-right: 10px solid red;
      padding: 0px 20px;
    }
  </style>
</head>
<body>
  <div class="father">
    <div class="son"></div>
  </div>
</body>
</html>